{layout name="layout/main" /}

{include file="adv/form" /}

<script>
    layui.use(['form', 'layer', 'upload'], function () {
        $ = layui.jquery;
        var form = layui.form;
        var layer = layui.layer;
        var upload = layui.upload;
        var url_insert = "{:url('admin/adv/insert')}";
        var url_update = "{:url('admin/adv/update')}";
        var url_upload = "{:url('admin/ajax/upload')}";
        var url_info = "{:url('admin/adv/info')}";
        var id = "{$Think.get.id|default=0}";
        var postData = {id:id};
        //对页面数据进行初始化
        form_obj.init(url_info, postData, form);
        //监听提交
        form_obj.submit(url_insert);
        //上传图片
        upload_obj.init('uploadElem', url_upload);
    });
</script>
